package org.flown.novel.data;

import javax.imageio.stream.FileImageOutputStream;
import java.io.File;
import java.io.IOException;

public enum DirectoryInformation
{
    BOOK("book"),
    COVER("cover"),;

    private final String name;

    DirectoryInformation(String name) {this.name = name;}
    public String getName() {return this.name;}
    public String getRealPath() {return System.getProperty("user.dir") + "/" + this.name;}

    public static void createDirectory()
    {
        File directory = new File(DirectoryInformation.BOOK.getRealPath());
        directory.mkdir();
        directory = new File(DirectoryInformation.COVER.getRealPath());
        directory.mkdir();

        File image_0_jpg = new File(DirectoryInformation.COVER.getRealPath() + "/0.jpg");
        if (!image_0_jpg.exists())
        {
            byte[] image = {
                    -1, -40, -1, -32, 0, 16, 74, 70,
                    73, 70, 0, 1, 1, 1, 1, 44,
                    1, 44, 0, 0, -1, -30, 2, -80,
                    73, 67, 67, 95, 80, 82, 79, 70,
                    73, 76, 69, 0, 1, 1, 0, 0,
                    2, -96, 108, 99, 109, 115, 4, 48,
                    0, 0, 109, 110, 116, 114, 82, 71,
                    66, 32, 88, 89, 90, 32, 7, -25,
                    0, 4, 0, 1, 0, 2, 0, 55,
                    0, 34, 97, 99, 115, 112, 65, 80,
                    80, 76, 0, 0, 0, 0, 0, 0,
                    0, 0, 0, 0, 0, 0, 0, 0,
                    0, 0, 0, 0, 0, 0, 0, 0,
                    0, 0, 0, 0, -10, -42, 0, 1,
                    0, 0, 0, 0, -45, 45, 108, 99,
                    109, 115, 0, 0, 0, 0, 0, 0,
                    0, 0, 0, 0, 0, 0, 0, 0,
                    0, 0, 0, 0, 0, 0, 0, 0,
                    0, 0, 0, 0, 0, 0, 0, 0,
                    0, 0, 0, 0, 0, 0, 0, 0,
                    0, 0, 0, 0, 0, 0, 0, 0,
                    0, 13, 100, 101, 115, 99, 0, 0, 1,
                    32, 0, 0, 0, 64, 99, 112, 114,
                    116, 0, 0, 1, 96, 0, 0, 0,
                    54, 119, 116, 112, 116, 0, 0, 1,
                    -104, 0, 0, 0, 20, 99, 104, 97,
                    100, 0, 0, 1, -84, 0, 0, 0,
                    44, 114, 88, 89, 90, 0, 0, 1,
                    -40, 0, 0, 0, 20, 98, 88, 89,
                    90, 0, 0, 1, -20, 0, 0, 0,
                    20, 103, 88, 89, 90, 0, 0, 2,
                    0, 0, 0, 0, 20, 114, 84, 82,
                    67, 0, 0, 2, 20, 0, 0, 0,
                    32, 103, 84, 82, 67, 0, 0, 2,
                    20, 0, 0, 0, 32, 98, 84, 82,
                    67, 0, 0, 2, 20, 0, 0, 0,
                    32, 99, 104, 114, 109, 0, 0, 2,
                    52, 0, 0, 0, 36, 100, 109, 110,
                    100, 0, 0, 2, 88, 0, 0, 0,
                    36, 100, 109, 100, 100, 0, 0, 2,
                    124, 0, 0, 0, 36, 109, 108, 117,
                    99, 0, 0, 0, 0, 0, 0, 0,
                    1, 0, 0, 0, 12, 101, 110, 85,
                    83, 0, 0, 0, 36, 0, 0, 0,
                    28, 0, 71, 0, 73, 0, 77, 0,
                    80, 0, 32, 0, 98, 0, 117, 0,
                    105, 0, 108, 0, 116, 0, 45, 0,
                    105, 0, 110, 0, 32, 0, 115, 0,
                    82, 0, 71, 0, 66, 109, 108, 117,
                    99, 0, 0, 0, 0, 0, 0, 0,
                    1, 0, 0, 0, 12, 101, 110, 85,
                    83, 0, 0, 0, 26, 0, 0, 0,
                    28, 0, 80, 0, 117, 0, 98, 0,
                    108, 0, 105, 0, 99, 0, 32, 0,
                    68, 0, 111, 0, 109, 0, 97, 0,
                    105, 0, 110, 0, 0, 88, 89, 90,
                    32, 0, 0, 0, 0, 0, 0, -10,
                    -42, 0, 1, 0, 0, 0, 0, -45,
                    45, 115, 102, 51, 50, 0, 0, 0,
                    0, 0, 1, 12, 66, 0, 0, 5,
                    -34, -1, -1, -13, 37, 0, 0, 7,
                    -109, 0, 0, -3, -112, -1, -1, -5,
                    -95, -1, -1, -3, -94, 0, 0, 3,
                    -36, 0, 0, -64, 110, 88, 89, 90,
                    32, 0, 0, 0, 0, 0, 0, 111,
                    -96, 0, 0, 56, -11, 0, 0, 3,
                    -112, 88, 89, 90, 32, 0, 0, 0,
                    0, 0, 0, 36, -97, 0, 0, 15,
                    -124, 0, 0, -74, -60, 88, 89, 90,
                    32, 0, 0, 0, 0, 0, 0, 98,
                    -105, 0, 0, -73, -121, 0, 0, 24,
                    -39, 112, 97, 114, 97, 0, 0, 0,
                    0, 0, 3, 0, 0, 0, 2, 102,
                    102, 0, 0, -14, -89, 0, 0, 13,
                    89, 0, 0, 19, -48, 0, 0, 10,
                    91, 99, 104, 114, 109, 0, 0, 0,
                    0, 0, 3, 0, 0, 0, 0, -93,
                    -41, 0, 0, 84, 124, 0, 0, 76,
                    -51, 0, 0, -103, -102, 0, 0, 38,
                    103, 0, 0, 15, 92, 109, 108, 117,
                    99, 0, 0, 0, 0, 0, 0, 0,
                    1, 0, 0, 0, 12, 101, 110, 85, 83,
                    0, 0, 0, 8, 0, 0, 0, 28, 0,
                    71, 0, 73, 0, 77, 0, 80, 109,
                    108, 117, 99, 0, 0, 0, 0, 0,
                    0, 0, 1, 0, 0, 0, 12, 101,
                    110, 85, 83, 0, 0, 0, 8, 0,
                    0, 0, 28, 0, 115, 0, 82, 0, 71,
                    0, 66, -1, -37, 0, 67, 0, 3,
                    2, 2, 3, 2, 2, 3, 3, 3,
                    3, 4, 3, 3, 4, 5, 8, 5,
                    5, 4, 4, 5, 10, 7, 7, 6,
                    8, 12, 10, 12, 12, 11, 10, 11,
                    11, 13, 14, 18, 16, 13, 14, 17,
                    14, 11, 11, 16, 22, 16, 17, 19, 20, 21, 21, 21, 12, 15, 23, 24, 22, 20, 24, 18, 20, 21, 20, -1, -37, 0, 67, 1, 3, 4, 4, 5, 4, 5, 9, 5, 5, 9, 20, 13, 11, 13, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, -1, -62, 0, 17, 8, 0, -126, 0, 100, 3, 1, 17, 0, 2, 17, 1, 3, 17, 1, -1, -60, 0, 28, 0, 1, 0, 3, 1, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 1, 2, 3, 8, -1, -60, 0, 20, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -38, 0, 12, 3, 1, 0, 2, 16, 3, 16, 0, 0, 1, -3, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 66, 9, 48, -104, 75, 42, -53, -96, 0, 0, -61, 24, -62, 1, -45, 11, -125, 30, 116, 112, 0, 0, -25, 70, 116, -7, 29, 72, -62, -111, 78, -68, 0, 0, 20, -60, 18, -52, -11, 34, 18, 75, 67, -24, 0, 0, 30, -89, -109, -56, 0, 0, 0, 51, -58, 4, -81, 53, 71, 47, 46, 78, -14, 123, -128, 0, 57, -31, -111, 38, 26, -77, 16, 66, 59, -16, 0, 0, 101, -118, 32, 74, 40, 10, 83, -70, -128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -1, -60, 0, 35, 16, 0, 2, 3, 1, 0, 2, 1, 4, 3, 0, 0, 0, 0, 0, 0, 0, 4, 5, 2, 3, 6, 1, 21, 32, 18, 0, 19, 20, 48, 53, 80, 96, -1, -38, 0, 8, 1, 1, 0, 1, 5, 2, -2, -87, -117, -118, 21, -12, 13, 32, 108, 111, -13, 35, -7, 54, 7, 86, -76, 74, 110, -127, 21, 43, 105, 6, -75, -5, -24, -87, -69, -91, 36, -72, -46, -89, -62, 89, -79, 122, -39, -71, -117, -86, 83, -54, 60, 102, 24, -104, 18, -65, -33, 91, 93, 22, 125, 101, 20, -8, 98, -108, 79, -15, -37, -69, -105, 32, -107, 126, -88, 106, 114, -71, -80, -69, -109, 59, -36, -75, 52, 29, 97, -103, -47, 13, 24, -75, -125, -102, -66, -59, -108, -112, -74, -12, 67, 16, 91, 85, 84, 57, 14, -72, 125, -70, -3, -7, -34, 75, -97, -83, -68, 89, -54, 56, -69, -103, 7, -104, -48, 105, -22, -68, -67, 17, 35, 114, -126, -101, -45, -45, 106, 100, -82, -2, -62, 63, 8, 123, 106, 6, 83, 59, 48, -43, -86, 36, 123, 10, 32, -102, -33, -1, 0, 55, 22, 93, 13, -3, 18, -7, -32, 61, -38, -36, -33, -106, -25, 18, 56, 82, 59, 89, 18, -51, -42, -104, 67, -17, 44, 69, -102, 1, -118, -110, 61, 5, 9, -1, 0, -55, 127, -1, -60, 0, 20, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, -1, -38, 0, 8, 1, 3, 1, 1, 63, 1, 93, -1, -60, 0, 20, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, -1, -38, 0, 8, 1, 2, 1, 1, 63, 1, 93, -1, -60, 0, 59, 16, 0, 2, 1, 3, 3, 1, 3, 7, 8, 11, 1, 0, 0, 0, 0, 0, 1, 2, 3, 4, 17, 18, 0, 5, 33, 19, 34, 49, 81, 6, 20, 48, 65, 97, 113, -127, 35, 50, 51, 66, 82, -111, -110, -63, 21, 32, 36, 67, 80, 96, 98, 114, 116, -109, -78, -77, -1, -38, 0, 8, 1, 1, 0, 6, 63, 2, -2, 21, 16, -104, 76, -51, 45, -15, 88, 33, 105, 79, 30, -59, 7, 73, 12, 75, 82, -84, -32, -107, 51, 83, 73, 24, 54, -17, -27, -122, -92, -95, 102, -23, -52, -72, 91, 46, -25, 44, 24, -40, 126, 19, -89, -87, -104, 63, 73, 62, 118, 11, -107, -121, -114, -110, 88, -100, 73, 27, -117, -85, 41, -72, 35, 83, -70, 35, 32, -118, 121, 32, 57, 122, -54, -101, 31, 65, 67, 44, 116, -109, 85, -86, 103, 113, 6, 57, 41, -20, -112, 123, 68, 120, 106, -98, -78, 13, -78, 115, -118, 62, 6, 118, 68, 67, -22, 11, 112, -52, 123, -14, -11, 107, 118, -127, -10, 104, 30, 80, -108, -20, -23, -25, -10, -62, -39, 21, 32, -31, -96, -21, -76, -55, 87, 31, 75, 57, 76, 115, 32, -61, -60, 114, 69, -11, 76, 105, -95, 90, 120, 93, 3, -84, 74, 56, 91, -13, -86, -4, 13, -54, -18, 21, 25, 126, 50, 127, 49, -24, 32, -21, -19, -108, 91, -128, 69, 119, -54, -78, 92, 4, 96, 124, -17, -86, 117, 10, 62, -33, -75, -45, -56, -86, -31, -86, 32, -108, -103, 77, -69, -2, -96, -15, 30, -67, 46, -2, -41, 90, 125, -38, 118, -124, -33, -20, -16, 32, 111, -114, 7, -3, -125, 85, -20, -58, -64, 64, -9, 39, -5, 78, -68, -30, 37, -110, 68, -91, -90, -115, 85, -15, -20, -53, 38, 54, -63, 124, 77, -20, 62, 58, -89, -94, -101, -127, 95, 2, -79, 127, 81, -87, 81, -37, -5, -57, -4, -97, 65, 35, -53, 114, 94, 6, -89, -9, 43, 119, -37, -33, -57, -35, -86, -120, 91, 53, 19, -75, -35, -107, -71, -18, 10, 71, -78, -31, 109, -58, -98, -118, 72, -57, -101, 50, 97, -128, -30, -61, -39, -81, 50, -88, -54, -94, 28, 2, 55, 80, -14, -2, -3, 81, -52, -32, -31, 73, -12, 80, 14, 35, 7, -19, 91, -60, 105, -87, -86, 1, -60, -10, -107, -108, -39, -111, -121, 115, 3, -22, 58, 85, -56, -67, -123, -78, 110, -13, -24, 46, 13, -57, -77, -46, 47, -24, -7, 105, 99, 22, 57, -7, -52, 108, -9, -16, -75, -104, 106, -126, 122, -125, 12, -44, 11, 74, 10, -59, 77, 3, -103, -3, -98, -66, 126, -19, 108, -92, 80, 110, 75, -45, -83, 15, -37, -94, 113, 127, -109, 126, 7, 28, -98, 117, 69, 83, 81, -71, -18, 59, 90, -53, -62, 71, 76, -99, -90, 54, -65, 43, -125, 27, -22, -106, 58, 79, 40, 119, -71, 33, -22, 17, 84, -26, -100, -34, 49, -115, -57, -18, -69, -55, -74, -109, 15, 42, 119, -53, 59, -12, -61, 24, 108, 50, -67, -83, 126, -113, -114, -107, 110, 90, -62, -41, 61, -25, -11, -30, -109, 112, -38, -91, -36, 36, -60, -123, 104, -87, 90, 108, 71, -61, -69, 84, 83, -59, -76, 61, 38, -32, -48, -28, 106, -106, -115, -110, 59, -37, -101, 55, 118, -68, -98, 90, -53, -102, -72, 55, 51, 4, -84, 69, -77, 43, 28, -99, -81, -113, 126, -68, -99, -1, 0, 41, -1, 0, -15, 125, 111, -86, 55, -35, -69, 107, -67, 74, -98, -107, 98, 2, -57, -28, -109, -97, -98, -70, -90, 110, -94, -53, 125, -56, 30, -94, 119, 55, -19, -99, -29, -48, 116, -10, -6, 74, 89, 99, 41, -52, -75, 19, -107, -79, -16, -80, 83, -86, 42, 105, -9, 10, 102, -91, -89, 76, 58, 81, 83, -101, -80, -73, -38, 45, -7, 107, 108, -122, 58, 10, -108, -114, -110, -81, -84, -11, 15, -120, -113, 28, 24, 113, -51, -2, -73, -122, -74, -119, 118, -8, 99, -106, 72, 42, 25, -49, 89, -79, 64, 58, 108, 57, -73, -65, 85, -45, -102, 93, -94, 83, 85, 40, -108, -27, 52, -99, -98, -54, -83, -66, -113, -6, 117, 13, 3, 83, -48, -55, 0, -84, 89, -40, -63, 51, 102, 7, 95, -88, 120, 42, 7, 31, -54, 127, -1, -60, 0, 37, 16, 1, 0, 2, 3, 1, 0, 2, 1, 3, 5, 0, 0, 0, 0, 0, 0, 1, 17, 33, 0, 49, 65, 81, 48, 97, -127, 16, 113, -95, 32, 80, 96, -111, -79, -1, -38, 0, 8, 1, 1, 0, 1, 63, 33, -2, -43, 119, -42, 109, -92, -40, 69, -104, 14, 28, -55, -16, 8, -32, 59, 16, 80, 0, 62, -56, 108, 93, 8, 84, -118, 75, -127, -61, 111, -47, -127, -62, -109, 66, -46, 57, 87, 97, 37, -101, 31, 74, 124, 4, -41, -58, -20, 85, 61, -5, -55, 40, 86, -121, 72, 0, -39, 47, 120, 127, 121, 54, -33, 125, 77, -14, 32, -9, 3, -2, 69, 38, 19, 100, -121, -95, -124, 26, -44, -128, 53, -81, -33, 30, 68, 8, 56, -91, -2, 62, 2, 108, 97, 6, 72, 81, -58, 1, 90, -47, -124, 44, 90, 114, 16, -120, 42, -33, 24, 40, 23, 109, 8, 57, -31, -128, 61, 14, -47, 0, 97, 26, -128, 88, 38, 7, -4, 64, -119, -121, 24, 97, 65, -109, -64, 87, -42, 19, -33, -128, 43, -9, -60, -4, 106, -104, 75, -10, 101, -55, -37, 99, -84, 60, 9, 83, 111, 92, 110, -17, 17, 26, -90, -110, 8, 77, 70, 0, -103, -56, -88, 17, -71, -71, -117, -9, 34, -7, 85, -36, 114, 30, 18, 30, 78, 77, 67, 27, 52, 2, -48, -40, -29, 38, -94, -2, 64, -3, -4, 6, -60, -38, 84, -104, -95, -74, 62, 56, 94, -33, 79, 28, 39, 119, 60, -51, 13, 117, 98, 61, 71, 19, 70, 37, 89, -32, -39, -122, 23, -10, 3, -125, -26, 26, 21, -104, -86, -90, 32, 1, -14, 47, 36, 18, -107, 70, -128, 34, -56, -27, -84, 33, 64, -108, 42, -114, 72, 28, 91, -102, -46, 82, -25, -20, 127, -82, -106, 126, -28, 92, 49, 118, 123, -112, -82, -88, -110, -124, -78, 123, -83, -50, 105, -72, -30, -109, 30, 65, -118, 123, 28, -3, 15, -122, -57, -60, 43, -26, -82, 107, -115, -25, 58, 112, 69, -18, -115, 59, -37, -16, 21, -99, 107, 109, 122, -118, -122, 103, -72, 28, -19, 68, -48, 39, -2, 76, 70, -68, 46, -111, 121, 116, -93, 18, 76, -15, 82, -106, -126, -2, 3, 120, 126, -18, 53, -111, 31, -20, -4, -30, -70, -40, -44, 80, -126, 73, -18, -113, 107, -4, 79, -1, -38, 0, 12, 3, 1, 0, 2, 0, 3, 0, 0, 0, 16, -110, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, 4, -110, 73, 32, -110, 65, 36, -110, 72, 0, 2, 73, 36, -128, 8, 32, -110, 73, 4, -110, 73, 36, -110, 73, 4, -126, 73, 36, -110, 0, 36, -110, 72, 32, -112, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, 36, -110, 73, -1, -60, 0, 20, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, -1, -38, 0, 8, 1, 3, 1, 1, 63, 16, 93, -1, -60, 0, 20, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, -1, -38, 0, 8, 1, 2, 1, 1, 63, 16, 93, -1, -60, 0, 34, 16, 1, 1, 0, 3, 0, 1, 4, 2, 3, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 33, 49, 81, 32, 48, 65, 97, 16, 113, 80, 96, -127, -1, -38, 0, 8, 1, 1, 0, 1, 63, 16, -2, 41, -94, 97, 2, -62, 104, -127, -39, 3, 102, -14, 76, -85, 15, -101, 110, 41, -95, 95, -84, 102, -64, 13, 0, 61, -87, 120, 67, 70, -82, -31, -80, 69, -5, 1, 13, 102, -88, 26, 71, -29, 14, 4, 94, 17, 64, -46, 35, 105, -124, 72, -93, 116, 117, 46, -59, 46, -28, -95, -49, 97, 51, -36, -51, 114, -18, -123, -11, 66, 26, -63, 64, -116, 98, -110, 80, 108, 32, 17, 24, 45, 27, -81, 41, -127, -75, -15, 5, -40, -16, -75, 4, 63, 5, -110, 33, 106, 31, 23, 88, 103, 15, -62, 36, 0, 22, -69, 58, -82, 55, 108, -30, -89, -121, -10, -17, -9, -40, -88, 22, -72, -121, -105, 4, -32, 27, 30, 99, -23, -19, -93, 43, 37, 70, 29, 80, -125, -122, 2, 15, 37, 64, 82, 33, 53, -76, 30, 24, 0, 127, -96, 72, -86, -16, 49, 106, 90, -88, -30, 45, -127, 69, 32, 10, -122, 6, 125, -91, 18, 80, -8, -51, -33, 47, -40, -88, 15, -60, 24, 59, -2, 64, 108, 121, -21, 113, -105, 70, 65, 117, -39, -53, -80, 82, 35, -127, 24, 13, 89, -127, 104, 109, 32, 80, 78, 98, 12, -21, 25, -11, -92, -81, -48, -92, 72, -52, -125, -119, 61, 48, -116, 6, -126, -80, 36, 7, 120, -18, -55, -115, 103, 84, 24, 7, 19, -59, 49, 8, -115, 65, 112, 10, -128, 42, 86, 6, -33, 90, -128, -85, 3, 14, 37, -47, 16, -6, 76, 84, -123, 48, -81, 95, 111, 73, 49, 86, -45, -63, 46, -6, 88, -111, -88, 67, 127, -125, 66, -122, 54, 13, 89, 36, -119, -35, -51, -33, 74, 6, -63, -36, -47, 34, -63, -127, -89, -19, -5, -6, -14, 104, 14, -52, -125, -22, 74, 40, -28, 32, 80, 18, -95, 71, 12, -64, 123, -28, -125, -75, -14, 71, 76, -60, 97, -24, 10, 2, 80, 10, -67, 117, -33, 91, 72, 70, -107, -69, 38, -70, -102, 93, -53, 24, -54, -56, -30, 26, 75, 17, -128, 64, -13, -68, -117, 83, 112, -110, -120, 31, 67, -123, -2, 10, -68, -125, -113, 31, -43, -61, -102, 94, -2, -96, -53, -75, 97, 84, -46, 0, -76, 28, 19, 111, 125, -126, 66, 74, 28, 20, 60, 1, -88, -76, 66, 85, -118, -85, 25, -112, 37, 17, -118, -115, -110, 23, 36, 22, -49, -105, -92, -44, 80, -114, 54, 76, -48, -7, -41, -50, -73, 41, 11, -88, -96, 84, 94, -116, 85, 98, -94, -108, -125, -31, -75, -121, -74, 16, 114, -89, 0, 77, 46, -48, 97, 127, 82, -1, -39
            };

            try {
                image_0_jpg.createNewFile();
                FileImageOutputStream out = new FileImageOutputStream(image_0_jpg);
                out.write(image);
                out.close();
            }
            catch (IOException e) {throw new RuntimeException(e);}
        }
    }
}


